﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EntityFramework.Translator
{
    public class AuthorityTranslator
    {
        //To Translate AuthorityDataEntity to AuthorityBusinessEntity
        public static BLL.Authority TranslatetoAuthorityBE(EntityFramework.Authority authorityDE)
        {
            BLL.Authority authorityBE = new BLL.Authority();
            authorityBE.AuthorityId = authorityDE.AuthorityId;
            authorityBE.AuthorityName = authorityDE.AuthorityName;
            //authorityBE.Level.LevelId = authorityDE.AuthorityLevel.LevelId;
            authorityBE.Level = Translator.AuthorityLeveltranslator.TranslatetoAuthorityLevelBE(authorityDE.AuthorityLevel);
            return authorityBE;
        }

        //To Translate AuthorityBusinessEntity to AuthorityDataEntity
        public static EntityFramework.Authority TranslatetoAuthorityDE(BLL.Authority authorityBE)
        {
            EntityFramework.Authority authorityDE = new EntityFramework.Authority();
            authorityDE.AuthorityId = authorityBE.AuthorityId;
            authorityDE.AuthorityName = authorityBE.AuthorityName;
            authorityDE.LevelId = authorityBE.Level.LevelId;
            //authorityDE.AuthorityId = authorityBE.Level.LevelId;
            //AuthorityLevel level = new AuthorityLevel();
            //level.LevelId = authorityBE.Level.LevelId;
            //level.LevelName = authorityBE.Level.LevelName;
            //authorityDE.AuthorityLevel = level;
           // authorityDE.AuthorityLevel = Translator.AuthorityLeveltranslator.TranslatetoAuthorityLevelDE(authorityBE.Level);
            return authorityDE;
        }
    }
}
